package data

import (
	"github.com/go-kratos/kratos/v2/errors"
	er "github.com/wenqingqaq/backend-lib/api/err/v1"
)

type BaseRepo struct {
	d *Data
}

func NewBaseRepo(d *Data) *BaseRepo {
	return &BaseRepo{d: d}
}

func dbErr(err error) *errors.Error {
	return er.ErrorDbError(err.Error()).WithCause(err)
}
